package com.lzy.huijinjiazu.mvp.ui.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jess.arms.utils.ArmsUtils;
import com.lzy.huijinjiazu.R;
import com.lzy.huijinjiazu.mvp.model.entity.Lable;
import com.lzy.huijinjiazu.mvp.ui.activity.BalanceActivity;
import com.lzy.huijinjiazu.mvp.ui.activity.FeedbackCenterActivity;
import com.lzy.huijinjiazu.mvp.ui.activity.FinanceOrderActivity;
import com.lzy.huijinjiazu.mvp.ui.activity.MyCollectActivity;
import com.lzy.huijinjiazu.mvp.ui.activity.MyPointsActivity;
import com.lzy.huijinjiazu.mvp.ui.activity.SelectAddressActivity;

/**
 * Created by long on 2018/1/13.
 */

public class MyMenuAdapter extends BaseQuickAdapter<Lable, BaseViewHolder> {
    public MyMenuAdapter() {
        super(R.layout.item_my_menu);
    }

    @Override
    protected void convert(BaseViewHolder helper, Lable item) {
        ((ImageView) helper.getView(R.id.iv_img)).setImageResource(item.getImg());
        ((TextView) helper.getView(R.id.tv_title)).setText(item.getTitle());
        helper.itemView.setOnClickListener(view -> {
            switch (helper.getLayoutPosition()) {
                case 0:
                    ArmsUtils.startActivity(FinanceOrderActivity.class);
                    break;
                case 1:
                    ArmsUtils.startActivity(BalanceActivity.class);
                    break;
                case 2:
                    ArmsUtils.startActivity(MyPointsActivity.class);
                    break;
                case 3:
                    ArmsUtils.startActivity(MyCollectActivity.class);
                    break;
                case 4:
                    ArmsUtils.startActivity(SelectAddressActivity.class);
                    break;
                case 5:
                    ArmsUtils.startActivity(FeedbackCenterActivity.class);
                    break;
            }
        });

    }
}
